<template>
	<view class="successfully">
		<cu-custom :isBack="true" textWeight="600" textColor="#333333" textSize="16" fhColor="#979797">
			<block slot="content">提交成功</block>
		</cu-custom>
		<view class="bac"></view>
		<view class="container" :style="{height:height-CustomBar+'px',paddingBottom:CustomBar+'px'}">
			<image class="img" :src="imgUrl+'Order/middle.png'" mode="widthFix"></image>
			<view class="title">订单提交成功</view>
			<view class="text">已成功提交订单，可前往个人中心进行查看</view>
			<view class="btnbox">
				<view class="btn" @click="toHome">返回首页</view>
				<view class="btn right" @click="toShop">查看详情</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				height: '',
				// 导航栏距离
				CustomBar: this.CustomBar,
				imgUrl: this.$http.imgUrl + '/static/',
				orderID: ''
			}
		},
		onLoad({
			id
		}) {
			this.orderID = id
		},
		mounted() {
			this.height = uni.getSystemInfoSync().windowHeight
		},
		methods: {
			// 点击回到首页
			toHome() {
				uni.reLaunch({
					url: '/pages/index/index'
				})
			},
			// 去订单详情页面
			toShop() {
				uni.redirectTo({
					url: '/pagesA/Order/OrderDetails?id=' + this.orderID
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
	.successfully {
		.bac {
			height: 100vh;
			width: 100%;
			position: fixed;
			top: 0;
			left: 0;
			background: url(https://lzmordershop.oss-cn-hangzhou.aliyuncs.com/static/bac.png) no-repeat;
			background-size: 100%;
		}

		.container {
			position: relative;
			width: 100%;
			display: flex;
			flex-direction: column;
			// justify-content: center;
			align-items: center;
			margin-top: 180rpx;
			.img {
				width: 166rpx;
				height: 166rpx;
			}

			.title {
				margin-top: 48rpx;
				font-size: 32rpx;
				font-weight: 600;
				color: #333333;
			}

			.text {
				margin-top: 24rpx;
				font-size: 24rpx;
				font-weight: 600;
				color: #999999;
			}

			.btnbox {
				margin-top: 104rpx;
				width: 658rpx;
				display: flex;
				justify-content: space-between;

				.btn {
					width: 304rpx;
					height: 76rpx;
					border-radius: 38rpx;
					border: 2rpx solid #4D8BFF;
					line-height: 72rpx;
					text-align: center;
					font-size: 28rpx;
					font-weight: 500;
					color: #4D8BFF;

					&.right {
						background: linear-gradient(135deg, #4D8BFF 0%, #78D8FB 100%);
						border: 0;
						line-height: 76rpx;
						color: #FFFFFF;
					}
				}
			}
		}
	}
</style>